﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KouDai.Core.Helper
{
    public static class SimpleThrowHelper
    {
        public static void ThrowNull<T>(T value, string throwMsg) where T : class
        {
            if (value == null)
            {
                throw new ArgumentNullException(throwMsg);
            }
        }

        public static void ThrowNullOrEmpty(string value, string throwMsg)
        {
            ThrowNull<string>(value, throwMsg);
            if (value.Length == 0)
            {
                throw new ArgumentException(null, throwMsg);
            }
        }
    }
}
